<extend name="Public/base"/>

<block name="body">
  <!-- 标题栏 -->
  <div class="main-title">
    <h2>广告图片列表</h2>

  </div>
    <div class="tools">
        <a class="btn" href="{:U('Slider/add')}">新 增</a>
        <button class="btn ajax-post" target-form="ids" url="{:U('Slider/setStatus',array('status'=>1))}">启 用</button>
        <button class="btn ajax-post" target-form="ids" url="{:U('Slider/setStatus',array('status'=>0))}">禁 用</button>
        <button class="btn ajax-post confirm" target-form="ids" url="{:U('Slider/setStatus',array('status'=>-1))}">删 除</button>
    </div>

  <!-- 数据列表 -->
  <div class="data-table">
        <div class="data-table table-striped">
<table class="">
    <thead>
      <tr>
        <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
        <th class="">ID</th>
        <th class="">图片</th>
        <th class="">标题</th>
        <th class="">创建时间</th>
        <th class="">状态</th>
        <th class="">操作</th>
      </tr>
    </thead>
    <tbody>
  <notempty name="list">
    <volist name="list" id="vo">
    <tr>
      <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.id}" /></td>
      <td>{$vo.id} </td>
      <td>
        <img src="./Uploads/{$vo.save_path}{$vo.save_name}" alt="{$vo.title}" width="50">
      </td>
      <td>{$vo.title|default='无'}</td>
      <td>{:date('Y/m/d',$vo['create_time'])}</td>
      <td>
        <eq name="vo.status" value="1">
          启用
        <else/>
          禁用
        </eq>
      </td>
      <td>
        <a href="{:U('Slider/setstatus?ids='.$vo['id'].'&status='.abs(1-$vo['status']))}" class="ajax-get">{$vo.status|show_status_op}</a>
        <a href="{:U('Slider/edit?id='.$vo['id'])}">编辑</a>
        <a href="{:U('Slider/del?id='.$vo['id'])}" class="confirm ajax-get">删除</a>
      </td>
    </tr>
    </volist>
    <else/>
    <td colspan="7" class="text-center"> aOh! 暂时还没有内容! </td>
    </notempty>
  </tbody>
    </table>

        </div>
    </div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
    <script type="text/javascript">
    $(function(){
        $("#search").click(function(){
          var url = $(this).attr('url');
          var status = $('select[name=status]').val();
          var search = $('input[name=search]').val();
          if(status != ''){
            url += '/status/' + status;
          }
          if(search != ''){
            url += '/search/' + search;
          }
          window.location.href = url;
        });
    });
    //导航高亮
    highlight_subnav('{:U('slider/index')}');
</script>
</block>
